<template>
	<view class="home">
		<view class="item">
			<view class="">顾客昵称:<text>{{details.name}}</text></view>
			<view class="">金额:<text>{{details.money}}元</text></view>
			<view class="">顾客电话:<text>{{details.telephone}}</text></view>
			<view class="">送达时间(最迟):<text>{{details.time}}</text></view>
		</view>

		<button type="primary" class="button" @click="nav">确定</button>
		
	</view>
</template>

<script>
	import wPicker from "@/pagesD/w-picker/w-picker.vue";
	export default {
		components: {
			wPicker
		},
		data() {
			return {
				visible:false,
				details: {},
				User: {}
			}
		},
		methods: {
			nav() {
				this.User = getApp().globalData.User;
				// console.log(this.User,'新')

				if ((JSON.stringify(this.User)) == '{}') {
					uni.showToast({
						title: '你还未登录哦'
					})
					return;
				}

				if (this.User.code == 0) {
					if (this.User.message.if_runner == 0) {
						uni.showToast({
							title: '你还不是跑手哦'
						})
						return;
					}
					this.$u.route(
						`/uview-ui/components/u-full-screen/u-full-screen?id=${this.details.id}&number=${this.User.message.student_number}`
					)
				} else {
					if (this.User.if_runner == 0) {
						uni.showToast({
							title: '你还不是跑手哦'
						})
						return;
					}
					this.$u.route(
						`/uview-ui/components/u-full-screen/u-full-screen?id=${this.details.id}&number=${this.User.student_number}`)
				}
			}
		},
		onLoad() {
			this.details = getApp().globalData.BoxOrFood;
		}
	}
</script>

<style lang="scss">
	.home {
		width: 100%;

		.item {
			width: 100%;
			font-size: 28rpx;
			margin-top: 20px;

			view {
				width: 690rpx;
				height: 140rpx;
				line-height: 140rpx;
				border-bottom: 1px solid #C0C0C0;
				display: flex;
				margin: 0 auto;

				text {
					display: block;
					margin-left: 50rpx;
				}
			}
		}

		.button {
			position: fixed;
			bottom: 80rpx;
			left: 50%;
			font-size: 32rpx;
			transform: translateX(-50%);
			background-color: $main-color;
			width: 90%;
		}
	}
</style>
